<?php
	class baivietbs
	{
		// Các trường
		public $MaBaiViet = 0;
        public $MaChuDe = '';
        public $MaNguoiDung = 0;
        public $TieuDe = '';
        public $TomTat = '';
        public $NoiDung = '';
        public $NgayDang = '';
        public $LuotXem = 0;
        public $KiemDuyet = 1;
        
        //Phan trang
        public $SoBaiViet = 6;
        public $P = 1;
        		
		// Các phương thức
		public function Add()
        {
            $db = new baivietdb();
            return $db->Add($this->MaChuDe, $this->MaNguoiDung, $this->TieuDe, $this->TomTat, $this->NoiDung, $this->NgayDang, $this->LuotXem, $this->KiemDuyet);
        }
        
        public function Update()
        {
            $db = new baivietdb();
            return $db->Update($this->MaBaiViet, $this->MaChuDe, $this->MaNguoiDung, $this->TieuDe, $this->TomTat, $this->NoiDung, $this->NgayDang, $this->LuotXem, $this->KiemDuyet);
        }
        
        public function Delete()
        {
            $db = new baivietdb();
            return $db->Delete($this->MaBaiViet);
        }
        
        public function TotalPage()
        {
            $db = new baivietdb();
			return $db->TotalPage($this->SoBaiViet, $this->MaChuDe);
        }
        
        public function Paging()
        {
            $db = new baivietdb();
			return $db->Paging($this->SoBaiViet, $this->P, $this->MaChuDe);
        }
        
        public function GetListArticle()
        {
            $db = new baivietdb();
			return $db->GetListArticle($this->MaBaiViet, $this->MaChuDe);
        }
        
        public function IssetArticle()
        {
            $db = new baivietdb();
			return $db->IssetArticle($this->TieuDe);
        }
        
        public function GetListArticleNotIn()
        {
            $db = new baivietdb();
			return $db->GetListArticleNotIn($this->TieuDe, $this->MaChuDe);
        }
	}
?>